package main

import (
	"fmt"
	"time"
)

// 只写通道
type OW chan<- int

// 只读通道
type OR <-chan int

func main() {
	c := make(chan int, 10)
	go provide(c)
	go consume(c)
	time.Sleep(time.Minute)
}

func provide(p OW) {
	counts := 0
	for {
		p <- counts
		counts++
	}
}

func consume(c OR) {
	for v := range c {
		fmt.Println(v)
	}
}
